var lyby = require('./util.js');
var route = function(options){
    lyby.apply(this,options);
};

route.routes = {
    community : function () {
        var r = require('./routes/community');
        this.app.use('/community', r);
    },
    users : function () {
        var r = require('./routes/users').router;
        this.app.use('/users', r);
    },
    index : function(){
        var routes = require('./routes/index');
        this.app.use('/', routes);
    }
}

route.init = function(app){
    var obj = new this({
        app : app
    });
    for(var key in route.routes){
        console.log(key+' is added. success.');
        if(route.routes[key] instanceof Function){
            route.routes[key].call(obj);
        }
    }
};
module.exports = route;